<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>编辑论文</title>
  <link rel="stylesheet" href="/style.css">
  <style>
    body {
      font-family: 'Arial', sans-serif;
      background-color: #f4f4f9;
    }

    .container {
      display: flex;
      max-width: 1200px;
      margin: 0 auto; /* 居中显示容器 */
    }

    /* Sidebar */
    .sidebar {
      width: 240px;
      background-color: #2c3e50;
      color: white;
      padding: 20px;
      height: 100vh;
      position: fixed;
      top: 0;
      left: 0;
    }

    .main-content {
      margin-left: 260px;
      padding: 40px;
      width: calc(100% - 260px); /* 留出空间给侧边栏 */
      max-width: 1100px; /* 限制最大宽度 */
    }

    .header {
      background-color: #ecf0f1;
      padding: 20px;
      border-radius: 8px;
      margin-bottom: 20px;
    }

    .header h1 {
      font-size: 32px;
      margin-bottom: 10px;
    }

    .paper-detail-card {
      display: flex;
      flex-direction: column;
      gap: 30px;
    }

    .detail-box {
      background-color: #ffffff;
      padding: 30px;
      border-radius: 8px;
      box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
      margin-bottom: 20px;
    }

    .detail-box h2, .detail-box h3 {
      color: #34495e;
      font-size: 22px;
      margin-bottom: 12px;
    }

    .detail-box input,
    .detail-box textarea {
      width: 100%;
      padding: 12px;
      font-size: 16px;
      border-radius: 5px;
      border: 1px solid #ccc;
      box-sizing: border-box;
      margin-bottom: 15px;
    }

    .detail-box textarea {
      min-height: 200px;
      resize: vertical;
    }

    .btn-primary {
      background-color: #3498db;
      color: white;
      border: none;
      padding: 15px 30px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 18px;
      transition: background-color 0.3s;
    }

    .btn-primary:hover {
      background-color: #2980b9;
    }
  </style>
</head>
<body>
<div class="container">
  <!-- Sidebar -->
  <div class="sidebar">
    <div class="sidebar-header">
      <h2>系统</h2>
    </div>
    <ul class="sidebar-menu">
      <li><a href="/home">仪表盘</a></li>
      <li><a href="/papers">论文管理</a></li>
    </ul>
  </div>

  <!-- Main content -->
  <div class="main-content">
    <header class="header">
      <h1>编辑论文</h1>
    </header>

    <section class="paper-detail-card">
      <form action="/papers" method="POST">
        <input type="hidden" name="id" th:value="${paper.id}">

        <!-- 论文标题 -->
        <div class="detail-box">
          <h2>标题</h2>
          <input type="text" name="title" id="title" th:value="${paper.title}" required>
        </div>

        <!-- 论文作者 -->
        <div class="detail-box">
          <h3>作者</h3>
          <input type="text" name="author" id="author" th:value="${paper.author}" required>
        </div>

        <!-- 论文摘要 -->
        <div class="detail-box">
          <h3>摘要</h3>
          <textarea name="abstractText" id="abstractText" rows="8" required th:text="${paper.abstractText}"></textarea>
        </div>

        <!-- 论文关键词 -->
        <div class="detail-box">
          <h3>关键词</h3>
          <input type="text" name="keywords" id="keywords" th:value="${paper.keywords}">
        </div>

        <!-- 论文发表日期 -->
        <div class="detail-box">
          <h3>发表日期</h3>
          <input type="date" name="pubdate" id="pubdate" th:value="${#dates.format(paper.pubdate, 'yyyy-MM-dd')}" required>
        </div>

        <!-- 提交按钮 -->
        <button type="submit" class="btn-primary">保存更改</button>
      </form>
    </section>
  </div>
</div>
</body>
</html>
